package com.SMP.service.meet_room;

import com.SMP.dao.MeetSubscribePersonMapper;
import com.SMP.model.MeetSubscribePerson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MeetSubscribePersonService {

    /**
     * @author SY
     * */
    @Autowired
    MeetSubscribePersonMapper meetSubscribePersonMapper;
    /**
     * @param /添加会议预约人员信息
     * @author SY
     * */
    public int addMeetSubscribePerson(MeetSubscribePerson  meetSubscribePerson) {

       return meetSubscribePersonMapper.insert(meetSubscribePerson);
    }

    /**
     * @param /修改会议预约人员信息
     * @author SY
     * */
    public int updMeetSubscribePerson(MeetSubscribePerson  meetSubscribePerson) {

        return meetSubscribePersonMapper.updateByPrimaryKey(meetSubscribePerson);
    }
    /**
     * @param /查询所有会议预约人员信息
     * @author SY
     * */
    public List<MeetSubscribePerson> selAllMeetSubscribePerson() {
        List<MeetSubscribePerson> list=meetSubscribePersonMapper.selectByExample(null);
        return list;

    }
    /**
     * @param /查询单个会议预约人员信息
     * @author SY
     * */
    public MeetSubscribePerson selMeetSubscribePerson(String id) {
        MeetSubscribePerson meetSubscribePerson=meetSubscribePersonMapper.selectByPrimaryKey(id);
        return meetSubscribePerson;
    }
    /**
     * @param /删除单个会议预约人员信息
     * @author SY
     * */
    public int delMeetSubscribePerson(String id) {
        MeetSubscribePerson meetSubscribePerson =meetSubscribePersonMapper.selectByPrimaryKey(id);
        meetSubscribePerson.setStandby1("0");
        return meetSubscribePersonMapper.updateByPrimaryKey(meetSubscribePerson);
    }
}
